/********************************************************************
* Copyright (c) 2012,TGS,All rights reserved.
* fileName:	RenderContext.h	
* created:	2013/04/23 9:53

* version:	1.6
* detail: 
*********************************************************************/

#pragma once

#include <TGS/MapControl2.0/config.h>
#include <TGS/MapControl2.0/MapToPixel.h>
#include <TGS/GeoMath2.0/Envelope.h>

class QPainter;

namespace TGS{
namespace MapControl{

/** \ingroup core
 * Contains information about the context of a rendering operation.
 * The context of a rendering operation defines properties such as
 * the conversion ratio between screen and map units, the extents /
 * bounding box to be rendered etc.
 **/
class MAPCONTROL_EXPORT RenderContext
{
	struct RenderContextPrivate;
public:
	typedef TGS::GeoMath::Envelope Envelope;
public:
    RenderContext();
    ~RenderContext();   
public:
	 //getters
    QPainter* painter();
    const QPainter* constPainter() const;

    const Envelope& extent() const;

    const MapToPixel& mapToPixel() const;

    double scaleFactor() const;

    double rasterScaleFactor() const;

    bool renderingStopped() const;

    bool forceVectorOutput() const;

    double rendererScale() const;

    //setters

    /**Sets coordinate transformation. QgsRenderContext takes ownership and deletes if necessary*/
    void setMapToPixel( const MapToPixel& mtp );
    void setExtent( const Envelope& extent );
    void setRenderingStopped( bool stopped );
    void setScaleFactor( double factor );
    void setRasterScaleFactor( double factor );
    void setRendererScale( double scale );
    void setPainter( QPainter* p );
    void setForceVectorOutput( bool force );

private:
	RenderContextPrivate* _data;
};

}//MapControl
}//TGS